import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './store'
import './plugins/element.js'
import './assets/css/global.css'
import './assets/fonts/iconfont.css'
import treeTable from 'vue-table-with-tree-grid'
import nav from './router/nav.vue'
import dayjs from 'dayjs'
// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
// 导入对应css样式
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
Vue.use(VueQuillEditor, /* { default global options } */ )
Vue.prototype.$dayjs = dayjs
Vue.config.productionTip = false
Vue.component('tree-table', treeTable)
Vue.component('nav-bread', nav)
    // 引入axios
import axios from 'axios'
// 配置请求根路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
    // 通过$http使用axios
Vue.prototype.$http = axios;
// 设置请求拦截器
axios.interceptors.request.use(config => {
    // 必须return config
    config.headers.Authorization = window.sessionStorage.getItem('token');
    return config
})
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')